package com.loong.shop.service.impl;

import com.loong.common.dubbo.service.AbstractService;
import com.loong.common.rest.rpc.RPCResponse;
import com.loong.shop.dto.GoodsSkuDTOResultInShop;
import com.loong.shop.handler.GoodsSkuHandler;
import com.loong.shop.service.IGoodsSkuService;
import org.apache.dubbo.config.annotation.DubboService;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description:
 * @Author: LiuQun
 * @Date: 2021/1/5 17:13
 */
@DubboService(timeout = 5000,interfaceClass = IGoodsSkuService.class)
public class GoodsSkuServiceImpl extends AbstractService implements IGoodsSkuService {
    @Override
    public RPCResponse<List<GoodsSkuDTOResultInShop>> findGoodsSkuListInSkuId(List<Long> skuIds) {
        return serviceExecutor.execute(() -> goodsSkuHandler.findGoodsSkuListInSkuId(skuIds));
    }

    @Resource
    private GoodsSkuHandler goodsSkuHandler;

    @Override
    public RPCResponse<GoodsSkuDTOResultInShop> findGoodsSkuBySkuId(Long skuId) {
        return serviceExecutor.execute(() -> goodsSkuHandler.findGoodsSkuBySkuId(skuId));
    }
}
